Adding support for Host header on checks#79
Closed
TrevinTeacutter wants to merge 1 commit intosourcegraph:masterfrom
TrevinTeacutter:master
Closed
Adding support for Host header on checks#79TrevinTeacutter wants to merge 1 commit intosourcegraph:masterfrom TrevinTeacutter:master
TrevinTeacutter wants to merge 1 commit intosourcegraph:masterfrom
TrevinTeacutter:master
Conversation
elimisteve
reviewed
Nov 26, 2018
|
|
||
| // Headers contains headers to added to the request | ||
| // that is sent for the check | ||
| Headers http.Header `json:"headers,omitempty"` |
There was a problem hiding this comment.
@TrevinTeacutter You can just add a Host header using the Headers field, right?
Author
There was a problem hiding this comment.
As checkup currently stands? No, because host is treated special and you can't just pass it into the Headers of a request object. I added it to the checker simply for parity with the actual request object.
titpetric
pushed a commit
to go-bridget/checkup
that referenced
this pull request
Apr 10, 2020
The Go standard library net/http.Request struct exposes a special header, which takes effect when issuing http requests. The Host header isn't honored, so I set this Host field from a Host header if present. Closes sourcegraph#79
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was trying to use this to check services behind
Traefik, and discovered that there wasn't a way to pass aHostheader so just trying to contribute this back. Wanted to keep parity with howHostis special onhttp.Requestso decided to not opt for parsing the header map for anyHostheader.